package xyz.labmem.base.sys.module.dict.controller.request

import io.swagger.annotations.ApiModelProperty
import xyz.labmem.base.core.base.BaseVerify
import javax.validation.constraints.Max
import javax.validation.constraints.NotBlank
import javax.validation.constraints.Size

/**
 * @Author lty
 * @Date 2021/12/20 11:40
 */
open class CreateDictTypeReq {

    @ApiModelProperty(value = "名称")
    @NotBlank(message = "名称不能为空", groups = [BaseVerify.put::class, BaseVerify.update::class])
    @Size(max = 200, message = "名称不能超过200个字符", groups = [BaseVerify.put::class, BaseVerify.update::class])
    var name: String? = null

    @ApiModelProperty(value = "编码")
    @NotBlank(message = "编码不能为空且唯一", groups = [BaseVerify.put::class, BaseVerify.update::class])
    @Size(max = 100, message = "编码不能超过100个字符", groups = [BaseVerify.put::class, BaseVerify.update::class])
    var code: String? = null

    @ApiModelProperty(value = "备注")
    @Size(max = 200, message = "备注不超过200字", groups = [BaseVerify.put::class, BaseVerify.update::class])
    var remark: String? = null

    @ApiModelProperty(value = "排序默认100")
    @Max(value = 99999, message = "排序值不超过5位数", groups = [BaseVerify.put::class, BaseVerify.update::class])
    var sort: Int = 100

}

class UpdateDictTypeReq : CreateDictTypeReq() {

    @ApiModelProperty(value = "主键")
    @NotBlank(message = "主键不能为空", groups = [BaseVerify.update::class])
    @Size(max = 50, message = "主键不能超过50个字符", groups = [BaseVerify.update::class])
    var id: String? = null

}